<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      /* 使用overflow: hiden将父容器设置为一个BFC容器 */
 

      #d1 {
        text-align: center;
        line-height: 100px;
        height: 100px;
        width: 100px;
        background: lightskyblue;
        color: #fff;
        float: left;
      }
      p{
        overflow: hidden;
        background: lightsalmon;
      }
    </style>
  </head>
  <body>
    <div id="container1">
      <div id="d1">div1</div>
      <p>12345679</p>
    </div>
    
  </body>
</html>
